Skip to content

fix(bedrock): normalize 3gp video format#2306

Open
he-yufeng wants to merge 1 commit into
strands-agents:mainfrom
he-yufeng:fix/bedrock-3gp-video-format
Open

fix(bedrock): normalize 3gp video format#2306
he-yufeng wants to merge 1 commit into
strands-agents:mainfrom
he-yufeng:fix/bedrock-3gp-video-format

Conversation

@he-yufeng
Copy link
Copy Markdown
Contributor

Summary

Fixes the Bedrock 3GP part of #2204.

Bedrock expects the video format enum to be three_gp, while common MIME/extension paths produce 3gp, 3gpp, or 3g2. The SDK currently forwards the value as-is, so a valid 3GP video content block can be rejected by the Bedrock Converse API.

This normalizes those aliases when formatting Bedrock video content blocks. Other media-format gaps from #2204 are left out of this PR.

To verify

Ran locally:

python -m pytest tests/strands/models/test_bedrock.py::test_format_request_maps_3gp_video_formats -q
python -m pytest tests/strands/models/test_bedrock.py -q
python -m ruff check src/strands/models/bedrock.py tests/strands/models/test_bedrock.py
python -m py_compile src/strands/models/bedrock.py tests/strands/models/test_bedrock.py
git diff --check

@he-yufeng he-yufeng force-pushed the fix/bedrock-3gp-video-format branch from 5944452 to e814ac7 Compare May 20, 2026 19:09
@github-actions github-actions Bot removed the size/s label May 20, 2026
@he-yufeng he-yufeng force-pushed the fix/bedrock-3gp-video-format branch from e814ac7 to 012dc57 Compare May 20, 2026 19:10
@github-actions github-actions Bot removed the size/s label May 20, 2026
@he-yufeng he-yufeng force-pushed the fix/bedrock-3gp-video-format branch from 012dc57 to 444de41 Compare May 27, 2026 09:53
@github-actions github-actions Bot added size/s and removed size/s labels May 27, 2026
@he-yufeng
Copy link
Copy Markdown
Contributor Author

Rebased this onto current main and revalidated the Bedrock model path. Current head is 444de41. Validation from strands-py: uv run pytest tests/strands/models/test_bedrock.py -q --basetemp ...tmp\pytest-2306 -p no:cacheprovider: 169 passed; uv run ruff check src/strands/models/bedrock.py tests/strands/models/test_bedrock.py; python -m py_compile strands-py\src\strands\models\bedrock.py strands-py\tests\strands\models\test_bedrock.py; git diff --check origin/main...HEAD. Note: ruff format --check wants to reformat pre-existing lines in origin/main's bedrock.py as well, so I did not include unrelated formatting churn in this PR.

@yonib05 yonib05 added area-provider Related to model providers bug Something isn't working python Pull requests that update python code labels May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-provider Related to model providers bug Something isn't working python Pull requests that update python code size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants